<?php
//
// Checking the status of a web page - Scriptol.com
//

$server="jveo.net";
function sockAccess($page)
{
   $errno="";
   $errstr="";
   $fp=0;
   global $server;
   $fp=fsockopen($server,80,$errno,$errstr,30);

   if($fp===0)
   {
      die("Error $errstr ($errno)");
   }
   $out="GET /$page HTTP/1.1\r\n";
   $out.="Host: $server\r\n";
   $out.="Connection: Close\r\n\r\n";

   fwrite($fp,$out);
   $content=fgets($fp);
   $code=trim(substr($content,9,4));
   fclose($fp);
   return intval($code);
}

echo "code=", " ", sockAccess(''), "\n";



?>